libtest.sh: use G_TEST_SRCDIR, G_TEST_BUILDDIR to find resources
authorSimon McVittie <smcv@debian.org>
Thu, 31 Mar 2016 17:29:44 +0000 (18:29 +0100)
committerColin Walters (automation) <walters+githubbot@verbum.org>
Thu, 31 Mar 2016 18:54:13 +0000 (18:54 +0000)
commitefb86ba9d32a038dd90f47f6e82f578e91b5fef5
treee45bd9f950ecf337b4e04088903f9f1e1a745ecf
parentbdf24cdc049b421d6e5a982ee9f25502407dceca
libtest.sh: use G_TEST_SRCDIR, G_TEST_BUILDDIR to find resources

This fixes the bug that in installed-tests that run testlib.sh under
"bash -c" (i.e. the C and JS tests), $(dirname $0) is "." and we can't do
the LD_PRELOAD correctly:

ERROR: ld.so: object './libreaddir-rand.so' from LD_PRELOAD cannot be
preloaded (cannot open shared object file): ignored.

Similarly, those tests can't copy gpghome correctly.

This also removes the confusing situation that SRCDIR in libtest.sh
(which is ${top_srcdir}/tests) does not mean the same thing as SRCDIR
in test-abi.sh (which is just ${top_srcdir}).

Signed-off-by: Simon McVittie <smcv@debian.org>
Closes: #234
Approved by: cgwalters
tests/libtest.sh
tests/test-archivez.sh
tests/test-delta.sh
tests/test-pull-archive-z.sh